# 1 导包
import time
import unittest

import HTMLTestRunner_PY3

import app
from script.test_login_parameterized import TestLoginScript
from script.test_employee_params import TestEmployee
# 2 创建测试套件
suite = unittest.TestSuite()
# 3 将测试用例添加到测试套件
suite.addTest(unittest.makeSuite(TestLoginScript))
suite.addTest(unittest.makeSuite(TestEmployee))

# 4 实例化runner，使用runner运行测试套件，生成测试报告
with open(file=app.DASE_DIR + "/report/report{}.html".format(time.strftime("%Y%m%d%H%M%S")), mode='wb') as f:
    # 实例化runner
    runner = HTMLTestRunner_PY3.HTMLTestRunner(f)
    # 使用runner运行测试套件，生成测试报告
    runner.run(suite)
print("是否进行轮巡构建")
